/**
*  \file deaddrop.h
*
*  \brief	Common definitions to access the values of the deaddrop.
*
*  \authors Michael J. Hohmann  michael.hohmann@linde-mh.de
*
*/
#ifndef DEADDROP_H_INCLUDED
#define DEADDROP_H_INCLUDED

/*================================================[ public includes  ]================================================*/
//#include "../cfg/prj.h"
#include "types.h"
/*================================================[ public defines   ]================================================*/

#define DEADDROP_RAM_ADDR   0x2000BFF0U


/**
* 	Address of the Deaddrop
*	This defines the start address for a deaddrop structure.
*/
#define DEADDROP_ADR ((void*)DEADDROP_RAM_ADDR)


/**
* 	Valid Flag Value
* 	This value is used to mark a flag a valid.
* 	The value was chosen in the assumption to be unlikely set by random for uninitialized RAM.
*/
#define VALID_FLAG_VALUE   ((unsigned int) 0xAAFF0055)

/**
*  	Invalid Valid Flag Value
* 	This value is used to mark a flag as invalid.
* 	The value was chosen in the assumption to be unlikely set by random for uninitialized RAM.
*/
#define INVALID_FLAG_VALUE ((unsigned int) ~VALID_FLAG_VALUE)

/**
* 	Pointer to the deaddrop structure
* 	This macro defines a pointer from type struct deaddrop to a specific address.
* 	It will be used to access the content of the struct.
* 	But care has to be taken because the linker does not know about the use of this
* 	memory area for this purpose.
*/
#define deaddrop_p  ((struct deaddrop* ) DEADDROP_ADR )

/*================================================[ public datatypes ]================================================*/

/**
*	Deaddrop Structure
*	The deaddrop structure is used to exchange information between the BOOT_BLOCK and
*	the CDX20_APPLIKATION.
*/
struct deaddrop
{
	U32 stay_in_bb_flag; 		/**< Set by APP read and cleared by BB */
	U32 start_application_flag;	/**< Only used by BB */
	U32 reset_reason;			/**< Set by BB read by APP */
};

/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2017 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
